package com.example.aidocengine.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.aidocengine.pojo.entity.DeviceStateTransition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DeviceStateTransitionMapper extends BaseMapper<DeviceStateTransition> {
    
    /**
     * 查询所有有效的状态转换规则
     */
    List<DeviceStateTransition> selectAllActive();
    
    /**
     * 根据设备类型和动作关键词查询状态转换
     */
    DeviceStateTransition selectByDeviceCategoryAndAction(
        @Param("deviceCategory") String deviceCategory, 
        @Param("actionKeyword") String actionKeyword);
    
    /**
     * 根据设备类型查询所有转换规则
     */
    List<DeviceStateTransition> selectByDeviceCategory(@Param("deviceCategory") String deviceCategory);
}